import { fromJS } from "immutable";
import * as actionTypes from "./constants";

const defaultState = fromJS({
    bannerList: [],
    enterLoading: true
});

export const reducer = (state = defaultState, action: any) => {
    switch (action.type) {
        case actionTypes.CHANGE_BANNER:
            return state.set('bannerList', action.data);
        case actionTypes.CHANGE_ENTER_LOADING:
            return state.set('enterLoading', action.data);         
        default:
            return state;
    }
};

